'use strict';
 const db = uniCloud.database();

exports.main = async (event, context) => {
  //event为客户端上传的参数
  // console.log('event : ' + event)
  const collection =  db.collection('tasks');

  let task_id=event.task_id
   let icon=event.receiver_icon;
   let id=event.receiver_id
   let name=event.receiver_name
   let phone=event.receiver_phone;
   let address=event.receiver_address;
  let  res=await collection.doc(task_id).update({
	  is_received:true,
	  receiver_name:name,
	  receiver_id:id,
	  receiver_icon:icon,
	  receiver_phone:phone,
	  receiver_address:address
	});

  //返回数据给客户端
  return {status:2}
};
